﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using _01_Tower4._0.GameFrame.System;
using _01_Tower4._0.Interface;
using _01_Tower4._0.Skills.Base;
using static System.Net.Mime.MediaTypeNames;

namespace _01_Tower4._0.Skills
{
    internal class Healing : DefSkill
    {
        public Healing() : base(51, "治疗魔法", "可以恢复少量生命值。(冷却：6回合。)", "使用了治疗魔法", 6, 10, 20, 0)
        {
        }

        public override void Use(IAttack caster)
        {
            if (Cd != 0)
            {
                InfoSystem.Instance.AddInfo($"{Name}仍在冷却中", ConsoleColor.Red);
                return;
            }
            caster.Mp -= Mp;
            if (caster.Mp <= 0)
            {
                InfoSystem.Instance.AddInfo($"法力值不足", ConsoleColor.Red);
                caster.Mp += Mp;
                return;
            }
            caster.Hp += Hp;
            if(caster.Hp > caster.MaxHp)caster.Hp = caster.MaxHp;
            caster.Def += Def;
            InfoSystem.Instance.AddInfo(caster.Name + FeedBack);
            InfoSystem.Instance.AddInfo($"{caster.Name}回复了{Hp}点生命值");
            base.Use(caster);
            Cd = 6;
        }
    }
}
